package com.wiscamp.ninechapters.problems.enums;

/**
 * 习题集类型枚举
 */
public enum SetTypes {
    EXERCISE(142001, "课间练习"),
    HOMEWORK(142002, "家庭作业"),
    EXAM(142003, "考试"),
    PRE_EXAM(142004, "模考"),
    CHALLENGE(142005, "竞赛"),
    ASSESSMENT(142006, "水平测评");

    private final int value;

    private final String name;

    SetTypes(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public static SetTypes valueOf(int value) {
        return switch (value) {
            case 142001 -> SetTypes.EXERCISE;
            case 142002 -> SetTypes.HOMEWORK;
            case 142003 -> SetTypes.EXAM;
            case 142004 -> SetTypes.PRE_EXAM;
            case 142005 -> SetTypes.CHALLENGE;
            case 142006 -> SetTypes.ASSESSMENT;
            default -> null;
        };
    }
}
